/*
 * Acesso.java
 *
 * Created on October 12, 2007, 10:46 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package petstore.model;

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Entity class Acesso
 * 
 * @author Tom Hayden
 */
@Entity
@Table(name = "acesso")
@AttributeOverride(name="id", column=@Column(name="cdacesso", nullable = false))
public class Acesso extends BusinessObject {

    @ManyToOne
    @JoinColumn(name="cdfuncao")
    private Funcao funcao;
    
    @ManyToOne
    @JoinColumn(name="cdtipoacesso")
    private TipoAcesso tipoAcesso;
    
    @Column(name = "dtatribuicaoacesso")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataAtribuicao;
    
    @Column(name = "ativo")
    private boolean active;

    /** Creates a new instance of Acesso */
    public Acesso() {
    }

    public Funcao getFuncao() {
        return funcao;
    }

    public void setFuncao(Funcao funcao) {
        this.funcao = funcao;
    }

    public TipoAcesso getTipoAcesso() {
        return tipoAcesso;
    }

    public void setTipoAcesso(TipoAcesso tipoAcesso) {
        this.tipoAcesso = tipoAcesso;
    }

    public Date getDataAtribuicao() {
        return dataAtribuicao;
    }

    public void setDataAtribuicao(Date dataAtribuicao) {
        this.dataAtribuicao = dataAtribuicao;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

}
